.class public Lcom/xingbook/ting/play/j;
.super Ljava/lang/Object;


# static fields
.field private static j:Lcom/xingbook/ting/play/j;


# instance fields
.field final a:Ljava/lang/String;

.field b:Lcom/xingbook/audio/b/a;

.field c:I

.field d:I

.field e:Ljava/util/Random;

.field public f:Ljava/lang/String;

.field public g:Lcom/xingbook/ting/play/g;

.field private h:I

.field private i:Landroid/content/Context;

.field private k:Ljava/lang/String;

.field private l:I

.field private m:J


# direct methods
.method static constructor <clinit>()V
    .locals 1

    const/4 v0, 0x0

    sput-object v0, Lcom/xingbook/ting/play/j;->j:Lcom/xingbook/ting/play/j;

    return-void
.end method

.method public constructor <init>(Landroid/content/Context;)V
    .locals 3

    const/4 v2, -0x1

    const/4 v1, 0x0

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    const-string v0, "CDRetriever"

    iput-object v0, p0, Lcom/xingbook/ting/play/j;->a:Ljava/lang/String;

    iput-object v1, p0, Lcom/xingbook/ting/play/j;->b:Lcom/xingbook/audio/b/a;

    iput v2, p0, Lcom/xingbook/ting/play/j;->c:I

    iput v2, p0, Lcom/xingbook/ting/play/j;->d:I

    const/4 v0, 0x0

    iput v0, p0, Lcom/xingbook/ting/play/j;->h:I

    new-instance v0, Ljava/util/Random;

    invoke-direct {v0}, Ljava/util/Random;-><init>()V

    iput-object v0, p0, Lcom/xingbook/ting/play/j;->e:Ljava/util/Random;

    iput-object v1, p0, Lcom/xingbook/ting/play/j;->i:Landroid/content/Context;

    iput-object v1, p0, Lcom/xingbook/ting/play/j;->f:Ljava/lang/String;

    sget-object v0, Lcom/xingbook/ting/play/g;->a:Lcom/xingbook/ting/play/g;

    iput-object v0, p0, Lcom/xingbook/ting/play/j;->g:Lcom/xingbook/ting/play/g;

    iput-object p1, p0, Lcom/xingbook/ting/play/j;->i:Landroid/content/Context;

    return-void
.end method

.method public static a()Lcom/xingbook/ting/play/j;
    .locals 1

    sget-object v0, Lcom/xingbook/ting/play/j;->j:Lcom/xingbook/ting/play/j;

    return-object v0
.end method

.method public static a(Landroid/content/Context;)Lcom/xingbook/ting/play/j;
    .locals 1

    sget-object v0, Lcom/xingbook/ting/play/j;->j:Lcom/xingbook/ting/play/j;

    if-nez v0, :cond_0

    new-instance v0, Lcom/xingbook/ting/play/j;

    invoke-direct {v0, p0}, Lcom/xingbook/ting/play/j;-><init>(Landroid/content/Context;)V

    sput-object v0, Lcom/xingbook/ting/play/j;->j:Lcom/xingbook/ting/play/j;

    :cond_0
    sget-object v0, Lcom/xingbook/ting/play/j;->j:Lcom/xingbook/ting/play/j;

    return-object v0
.end method

.method public static a(I)Ljava/lang/String;
    .locals 1

    packed-switch p0, :pswitch_data_0

    const/4 v0, 0x0

    :goto_0
    return-object v0

    :pswitch_0
    const-string v0, "\u5217\u8868\u5faa\u73af"

    goto :goto_0

    :pswitch_1
    const-string v0, "\u5355\u66f2\u5faa\u73af"

    goto :goto_0

    :pswitch_2
    const-string v0, "\u987a\u5e8f\u64ad\u653e"

    goto :goto_0

    :pswitch_data_0
    .packed-switch 0x0
        :pswitch_0
        :pswitch_1
        :pswitch_2
    .end packed-switch
.end method

.method public static k()V
    .locals 9

    const-wide/16 v7, 0x0

    invoke-static {}, Lcom/xingbook/ting/play/j;->a()Lcom/xingbook/ting/play/j;

    move-result-object v0

    if-eqz v0, :cond_1

    iget-object v1, v0, Lcom/xingbook/ting/play/j;->k:Ljava/lang/String;

    if-eqz v1, :cond_0

    iget-wide v1, v0, Lcom/xingbook/ting/play/j;->m:J

    cmp-long v1, v1, v7

    if-lez v1, :cond_0

    iget v1, v0, Lcom/xingbook/ting/play/j;->l:I

    iget-object v2, v0, Lcom/xingbook/ting/play/j;->k:Ljava/lang/String;

    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v3

    iget-wide v5, v0, Lcom/xingbook/ting/play/j;->m:J

    sub-long/2addr v3, v5

    long-to-int v3, v3

    const/4 v4, 0x1

    invoke-static {v1, v2, v3, v4}, Lcom/xingbook/park/d/j;->a(ILjava/lang/String;IZ)V

    const/4 v1, -0x1

    iput v1, v0, Lcom/xingbook/ting/play/j;->l:I

    const/4 v1, 0x0

    iput-object v1, v0, Lcom/xingbook/ting/play/j;->k:Ljava/lang/String;

    iput-wide v7, v0, Lcom/xingbook/ting/play/j;->m:J

    :cond_0
    invoke-direct {v0}, Lcom/xingbook/ting/play/j;->l()V

    :cond_1
    return-void
.end method

.method private l()V
    .locals 2

    const/4 v0, -0x1

    const/4 v1, 0x0

    iput-object v1, p0, Lcom/xingbook/ting/play/j;->b:Lcom/xingbook/audio/b/a;

    iput v0, p0, Lcom/xingbook/ting/play/j;->c:I

    iput v0, p0, Lcom/xingbook/ting/play/j;->d:I

    const/4 v0, 0x0

    iput v0, p0, Lcom/xingbook/ting/play/j;->h:I

    iput-object v1, p0, Lcom/xingbook/ting/play/j;->f:Ljava/lang/String;

    iput-object v1, p0, Lcom/xingbook/ting/play/j;->i:Landroid/content/Context;

    sget-object v0, Lcom/xingbook/ting/play/g;->a:Lcom/xingbook/ting/play/g;

    iput-object v0, p0, Lcom/xingbook/ting/play/j;->g:Lcom/xingbook/ting/play/g;

    sput-object v1, Lcom/xingbook/ting/play/j;->j:Lcom/xingbook/ting/play/j;

    return-void
.end method

.method private m()V
    .locals 3

    iget-object v0, p0, Lcom/xingbook/ting/play/j;->i:Landroid/content/Context;

    if-nez v0, :cond_0

    invoke-static {}, Lcom/xingbook/park/activity/HomeActivity;->a()Landroid/app/Activity;

    move-result-object v0

    iput-object v0, p0, Lcom/xingbook/ting/play/j;->i:Landroid/content/Context;

    :cond_0
    :try_start_0
    iget v0, p0, Lcom/xingbook/ting/play/j;->d:I

    iget v1, p0, Lcom/xingbook/ting/play/j;->c:I

    if-eq v0, v1, :cond_1

    iget v0, p0, Lcom/xingbook/ting/play/j;->c:I

    iput v0, p0, Lcom/xingbook/ting/play/j;->d:I

    :cond_1
    new-instance v0, Landroid/content/Intent;

    const-string v1, "com.xingpark.ting.play.cditem.action.change"

    invoke-direct {v0, v1}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

    const-string v1, "selected"

    iget v2, p0, Lcom/xingbook/ting/play/j;->c:I

    invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->putExtra(Ljava/lang/String;I)Landroid/content/Intent;

    iget-object v1, p0, Lcom/xingbook/ting/play/j;->i:Landroid/content/Context;

    invoke-virtual {v1, v0}, Landroid/content/Context;->sendBroadcast(Landroid/content/Intent;)V

    invoke-direct {p0}, Lcom/xingbook/ting/play/j;->q()V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    :goto_0
    return-void

    :catch_0
    move-exception v0

    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V

    goto :goto_0
.end method

.method private n()V
    .locals 3

    iget-object v0, p0, Lcom/xingbook/ting/play/j;->i:Landroid/content/Context;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/xingbook/ting/play/j;->i:Landroid/content/Context;

    const-string v1, "\u64ad\u653e\u5217\u8868\u4e3a\u7a7a"

    const/4 v2, 0x0

    invoke-static {v0, v1, v2}, Landroid/widget/Toast;->makeText(Landroid/content/Context;Ljava/lang/CharSequence;I)Landroid/widget/Toast;

    move-result-object v0

    invoke-virtual {v0}, Landroid/widget/Toast;->show()V

    :cond_0
    return-void
.end method

.method private o()V
    .locals 3

    iget-object v0, p0, Lcom/xingbook/ting/play/j;->i:Landroid/content/Context;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/xingbook/ting/play/j;->i:Landroid/content/Context;

    const-string v1, "\u5df2\u7ecf\u662f\u7b2c\u4e00\u9996"

    const/4 v2, 0x0

    invoke-static {v0, v1, v2}, Landroid/widget/Toast;->makeText(Landroid/content/Context;Ljava/lang/CharSequence;I)Landroid/widget/Toast;

    move-result-object v0

    invoke-virtual {v0}, Landroid/widget/Toast;->show()V

    :cond_0
    return-void
.end method

.method private p()V
    .locals 3

    iget-object v0, p0, Lcom/xingbook/ting/play/j;->i:Landroid/content/Context;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/xingbook/ting/play/j;->i:Landroid/content/Context;

    const-string v1, "\u5df2\u7ecf\u662f\u6700\u540e\u4e00\u9996"

    const/4 v2, 0x0

    invoke-static {v0, v1, v2}, Landroid/widget/Toast;->makeText(Landroid/content/Context;Ljava/lang/CharSequence;I)Landroid/widget/Toast;

    move-result-object v0

    invoke-virtual {v0}, Landroid/widget/Toast;->show()V

    :cond_0
    return-void
.end method

.method private q()V
    .locals 6

    iget-object v0, p0, Lcom/xingbook/ting/play/j;->k:Ljava/lang/String;

    if-eqz v0, :cond_0

    iget v0, p0, Lcom/xingbook/ting/play/j;->l:I

    iget-object v1, p0, Lcom/xingbook/ting/play/j;->k:Ljava/lang/String;

    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v2

    iget-wide v4, p0, Lcom/xingbook/ting/play/j;->m:J

    sub-long/2addr v2, v4

    long-to-int v2, v2

    const/4 v3, 0x1

    invoke-static {v0, v1, v2, v3}, Lcom/xingbook/park/d/j;->a(ILjava/lang/String;IZ)V

    const/4 v0, -0x1

    iput v0, p0, Lcom/xingbook/ting/play/j;->l:I

    const/4 v0, 0x0

    iput-object v0, p0, Lcom/xingbook/ting/play/j;->k:Ljava/lang/String;

    const-wide/16 v0, 0x0

    iput-wide v0, p0, Lcom/xingbook/ting/play/j;->m:J

    :cond_0
    invoke-virtual {p0}, Lcom/xingbook/ting/play/j;->g()Lcom/xingbook/audio/b/b;

    move-result-object v0

    if-eqz v0, :cond_1

    invoke-virtual {v0}, Lcom/xingbook/audio/b/b;->s()I

    move-result v1

    iput v1, p0, Lcom/xingbook/ting/play/j;->l:I

    invoke-virtual {v0}, Lcom/xingbook/audio/b/b;->t()Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcom/xingbook/ting/play/j;->k:Ljava/lang/String;

    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v0

    iput-wide v0, p0, Lcom/xingbook/ting/play/j;->m:J

    :cond_1
    return-void
.end method


# virtual methods
.method public a(Lcom/xingbook/audio/b/a;)V
    .locals 1

    if-nez p1, :cond_0

    :goto_0
    return-void

    :cond_0
    const/4 v0, -0x1

    iput v0, p0, Lcom/xingbook/ting/play/j;->c:I

    iput-object p1, p0, Lcom/xingbook/ting/play/j;->b:Lcom/xingbook/audio/b/a;

    invoke-virtual {p1}, Lcom/xingbook/audio/b/a;->t()Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcom/xingbook/ting/play/j;->f:Ljava/lang/String;

    goto :goto_0
.end method

.method public b(I)Lcom/xingbook/audio/b/b;
    .locals 2

    iget-object v0, p0, Lcom/xingbook/ting/play/j;->b:Lcom/xingbook/audio/b/a;

    if-eqz v0, :cond_0

    if-ltz p1, :cond_0

    iget-object v0, p0, Lcom/xingbook/ting/play/j;->b:Lcom/xingbook/audio/b/a;

    invoke-virtual {v0}, Lcom/xingbook/audio/b/a;->h()Ljava/util/ArrayList;

    move-result-object v0

    invoke-virtual {v0}, Ljava/util/ArrayList;->size()I

    move-result v0

    add-int/lit8 v0, v0, -0x1

    if-le p1, v0, :cond_1

    :cond_0
    const/4 v0, 0x0

    :goto_0
    return-object v0

    :cond_1
    iput p1, p0, Lcom/xingbook/ting/play/j;->c:I

    invoke-direct {p0}, Lcom/xingbook/ting/play/j;->m()V

    iget-object v0, p0, Lcom/xingbook/ting/play/j;->b:Lcom/xingbook/audio/b/a;

    invoke-virtual {v0}, Lcom/xingbook/audio/b/a;->h()Ljava/util/ArrayList;

    move-result-object v0

    iget v1, p0, Lcom/xingbook/ting/play/j;->c:I

    invoke-virtual {v0, v1}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/xingbook/audio/b/b;

    goto :goto_0
.end method

.method public b()V
    .locals 0

    invoke-direct {p0}, Lcom/xingbook/ting/play/j;->m()V

    return-void
.end method

.method public c()Lcom/xingbook/audio/b/a;
    .locals 1

    iget-object v0, p0, Lcom/xingbook/ting/play/j;->b:Lcom/xingbook/audio/b/a;

    return-object v0
.end method

.method public c(I)V
    .locals 0

    iput p1, p0, Lcom/xingbook/ting/play/j;->h:I

    return-void
.end method

.method public d()I
    .locals 2

    iget-object v0, p0, Lcom/xingbook/ting/play/j;->b:Lcom/xingbook/audio/b/a;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/xingbook/ting/play/j;->b:Lcom/xingbook/audio/b/a;

    invoke-virtual {v0}, Lcom/xingbook/audio/b/a;->h()Ljava/util/ArrayList;

    move-result-object v0

    invoke-virtual {v0}, Ljava/util/ArrayList;->size()I

    move-result v0

    if-gtz v0, :cond_1

    :cond_0
    invoke-direct {p0}, Lcom/xingbook/ting/play/j;->n()V

    :cond_1
    iget v0, p0, Lcom/xingbook/ting/play/j;->c:I

    if-gez v0, :cond_2

    const/4 v0, 0x0

    iput v0, p0, Lcom/xingbook/ting/play/j;->c:I

    :cond_2
    iget v0, p0, Lcom/xingbook/ting/play/j;->c:I

    invoke-virtual {p0}, Lcom/xingbook/ting/play/j;->h()I

    move-result v1

    add-int/lit8 v1, v1, -0x1

    if-le v0, v1, :cond_3

    invoke-virtual {p0}, Lcom/xingbook/ting/play/j;->h()I

    move-result v0

    add-int/lit8 v0, v0, -0x1

    iput v0, p0, Lcom/xingbook/ting/play/j;->c:I

    :cond_3
    iget v0, p0, Lcom/xingbook/ting/play/j;->c:I

    return v0
.end method

.method public e()I
    .locals 2

    const/4 v0, -0x1

    iget v1, p0, Lcom/xingbook/ting/play/j;->c:I

    add-int/lit8 v1, v1, -0x1

    iput v1, p0, Lcom/xingbook/ting/play/j;->c:I

    iget-object v1, p0, Lcom/xingbook/ting/play/j;->b:Lcom/xingbook/audio/b/a;

    if-eqz v1, :cond_0

    iget-object v1, p0, Lcom/xingbook/ting/play/j;->b:Lcom/xingbook/audio/b/a;

    invoke-virtual {v1}, Lcom/xingbook/audio/b/a;->h()Ljava/util/ArrayList;

    move-result-object v1

    invoke-virtual {v1}, Ljava/util/ArrayList;->size()I

    move-result v1

    if-gtz v1, :cond_1

    :cond_0
    iget v1, p0, Lcom/xingbook/ting/play/j;->c:I

    add-int/lit8 v1, v1, 0x1

    iput v1, p0, Lcom/xingbook/ting/play/j;->c:I

    invoke-direct {p0}, Lcom/xingbook/ting/play/j;->n()V

    :goto_0
    return v0

    :cond_1
    iget v1, p0, Lcom/xingbook/ting/play/j;->c:I

    if-gez v1, :cond_2

    iget v1, p0, Lcom/xingbook/ting/play/j;->h:I

    if-nez v1, :cond_3

    iget-object v0, p0, Lcom/xingbook/ting/play/j;->b:Lcom/xingbook/audio/b/a;

    invoke-virtual {v0}, Lcom/xingbook/audio/b/a;->h()Ljava/util/ArrayList;

    move-result-object v0

    invoke-virtual {v0}, Ljava/util/ArrayList;->size()I

    move-result v0

    add-int/lit8 v0, v0, -0x1

    iput v0, p0, Lcom/xingbook/ting/play/j;->c:I

    :cond_2
    iget v0, p0, Lcom/xingbook/ting/play/j;->c:I

    goto :goto_0

    :cond_3
    iget v1, p0, Lcom/xingbook/ting/play/j;->c:I

    add-int/lit8 v1, v1, 0x1

    iput v1, p0, Lcom/xingbook/ting/play/j;->c:I

    invoke-direct {p0}, Lcom/xingbook/ting/play/j;->o()V

    goto :goto_0
.end method

.method public f()I
    .locals 4

    const/4 v3, 0x0

    const/4 v0, -0x1

    iget v1, p0, Lcom/xingbook/ting/play/j;->c:I

    add-int/lit8 v1, v1, 0x1

    iput v1, p0, Lcom/xingbook/ting/play/j;->c:I

    iget v1, p0, Lcom/xingbook/ting/play/j;->c:I

    if-gez v1, :cond_0

    iput v3, p0, Lcom/xingbook/ting/play/j;->c:I

    :cond_0
    iget-object v1, p0, Lcom/xingbook/ting/play/j;->b:Lcom/xingbook/audio/b/a;

    if-eqz v1, :cond_1

    iget-object v1, p0, Lcom/xingbook/ting/play/j;->b:Lcom/xingbook/audio/b/a;

    invoke-virtual {v1}, Lcom/xingbook/audio/b/a;->h()Ljava/util/ArrayList;

    move-result-object v1

    invoke-virtual {v1}, Ljava/util/ArrayList;->size()I

    move-result v1

    if-gtz v1, :cond_2

    :cond_1
    iget v1, p0, Lcom/xingbook/ting/play/j;->c:I

    add-int/lit8 v1, v1, -0x1

    iput v1, p0, Lcom/xingbook/ting/play/j;->c:I

    invoke-direct {p0}, Lcom/xingbook/ting/play/j;->n()V

    :goto_0
    return v0

    :cond_2
    iget v1, p0, Lcom/xingbook/ting/play/j;->c:I

    iget-object v2, p0, Lcom/xingbook/ting/play/j;->b:Lcom/xingbook/audio/b/a;

    invoke-virtual {v2}, Lcom/xingbook/audio/b/a;->h()Ljava/util/ArrayList;

    move-result-object v2

    invoke-virtual {v2}, Ljava/util/ArrayList;->size()I

    move-result v2

    add-int/lit8 v2, v2, -0x1

    if-le v1, v2, :cond_3

    iget v1, p0, Lcom/xingbook/ting/play/j;->h:I

    if-nez v1, :cond_4

    iput v3, p0, Lcom/xingbook/ting/play/j;->c:I

    :cond_3
    iget v0, p0, Lcom/xingbook/ting/play/j;->c:I

    goto :goto_0

    :cond_4
    iget v1, p0, Lcom/xingbook/ting/play/j;->c:I

    add-int/lit8 v1, v1, -0x1

    iput v1, p0, Lcom/xingbook/ting/play/j;->c:I

    invoke-direct {p0}, Lcom/xingbook/ting/play/j;->p()V

    goto :goto_0
.end method

.method public g()Lcom/xingbook/audio/b/b;
    .locals 2

    :try_start_0
    iget-object v0, p0, Lcom/xingbook/ting/play/j;->b:Lcom/xingbook/audio/b/a;

    invoke-virtual {v0}, Lcom/xingbook/audio/b/a;->h()Ljava/util/ArrayList;

    move-result-object v0

    iget v1, p0, Lcom/xingbook/ting/play/j;->c:I

    invoke-virtual {v0, v1}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/xingbook/audio/b/b;
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    :goto_0
    return-object v0

    :catch_0
    move-exception v0

    const/4 v0, 0x0

    goto :goto_0
.end method

.method public h()I
    .locals 1

    iget-object v0, p0, Lcom/xingbook/ting/play/j;->b:Lcom/xingbook/audio/b/a;

    if-nez v0, :cond_0

    const/4 v0, 0x0

    :goto_0
    return v0

    :cond_0
    iget-object v0, p0, Lcom/xingbook/ting/play/j;->b:Lcom/xingbook/audio/b/a;

    invoke-virtual {v0}, Lcom/xingbook/audio/b/a;->h()Ljava/util/ArrayList;

    move-result-object v0

    invoke-virtual {v0}, Ljava/util/ArrayList;->size()I

    move-result v0

    goto :goto_0
.end method

.method public i()I
    .locals 1

    iget v0, p0, Lcom/xingbook/ting/play/j;->h:I

    return v0
.end method

.method public j()I
    .locals 1

    iget v0, p0, Lcom/xingbook/ting/play/j;->h:I

    add-int/lit8 v0, v0, 0x1

    rem-int/lit8 v0, v0, 0x3

    iput v0, p0, Lcom/xingbook/ting/play/j;->h:I

    iget v0, p0, Lcom/xingbook/ting/play/j;->h:I

    return v0
.end method
